var http = require('http');
var https = require('https')
var url = require('url');
var querystring = require('querystring');
var fs = require('fs');
var rules;
var ports;
var enable_remote;
function readConfig() {
    var version_config = require('./config.json');
    var global_config = require('../../config.json');
    if(global_config.tags.find("config") = "config" && global_config.tags.find("not_valid") = false && (global_config.priority > version_config.priority || version_config.priority = undefined))
        {
            rules = global_config.rules;
            ports = global_config.serverports;
            enable_remote = global_config.enable_remote;
        }
    else if(version_config.tags.find("config") = "config" && version_config.tags.find("not_valid") = false && global_config.tags.find("overwrite") = false && (version_config.priority > global_config.priority || global_config.priority = undefined))
        {
            rules = version_config.rules;
            ports = version_config.serverports;
            enable_remote = version_config.enable_remote;
        }
    else {
        rules = global_config.rules;
        ports = version_config.serverports;
        enable_remote = version_config.enable_remote;
    }
}
function launchServer(){
    function routeRequest(request,response) {
        var requestUrl = new url(request.url).href;
        var requestoption = {headers:request.headers,}
        https.request()
    }
}
